/**
 * 模块主js
 */

export default {
    /**
     * 数据表格加载
     * @param {*VUE} parent 
     * @param {number} page 
     */
    getList(parent, page, afterLoadFn){
        parent.loading = true;
        page = page? page:1;   
        parent.$c.PigeonsGet('aurora/ulog/list', 
          {page: page}, 
          (result)=>{
            // console.log(result);
            if(result.code == 200){
              parent.items = result.list;
              if('function' == typeof afterLoadFn){
                afterLoadFn(result.list)
              }
            }
          },
          (error, httpMK)=>{
            parent.$message({message: error, type: 'warning'});
          },
          () =>{
            parent.loading = false;
            parent.fullscreenLoading = false;
          }
        )
    },
    getRecord(parent, data, page){
      if(!data || 'object' != typeof data){
        data = {}
      }
      page = page? page:1; 
      data.page = page
      parent.$c.PigeonsGet('aurora/ulog/record', 
        data, 
        (result)=>{
          if(result.code == 200){
            parent.records = result.data
          }
        },
        (error, httpMK)=>{
          parent.$message({message: error, type: 'warning'});
        },
        () =>{
          parent.loading = false;
          parent.fullscreenLoading = false;
        }
      )
    }
}